<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html">
    <body>
        <ui:composition template="./templates/default2.xhtml">         
            <ui:define name="content">
                <h:form >
                    <font size="5" color ="grey">SMART Track - MerlionFood initiative</font>
                    <hr></hr>
                    
                    
                        <table >
                            <tr>
                                <td>Sales order no.:</td>
                                <td> <p:inputText value="#{salesOrderManagerBean.salesOrderNumber}"> 
                                       
                                    </p:inputText>
                                </td>

                            </tr>
                            <tr>
                                <td>Registered email:</td>
                                <td> 
                                    <p:inputText  value="#{salesOrderManagerBean.customerEmail}" /> 
                                </td>
                            </tr> 

                            
                            <tr><td></td>
                                <td>  <p:commandButton value="GET" actionListener="#{salesOrderManagerBean.tracking}" update="status,tracking" ajax="true"/>
                                <p:commandButton value="Back" actionListener="#{profileManagerBean.logout}" /> 
                                </td>
                            </tr>
                        </table>
                        <br/><font color="red"> &nbsp; <h:outputText id ="status" value="#{salesOrderManagerBean.remark}"  /> </font>
                        <br/>
                        <br/>
                        
                        <hr></hr>
                        
                         <p:dataTable id="tracking" var="tracking" value="#{salesOrderManagerBean.tis}">
                                   <p:column headerText="Date"  > 
                                    <h:outputText value="#{tracking.creationDate}"/> 
                                   </p:column>
                                     <p:column headerText="Status" > 
                                    <h:outputText value="#{tracking.description}"/> 
                                   </p:column>
                               </p:dataTable>
                       
                        
                 
                </h:form>
            </ui:define>        
        </ui:composition>
    </body>
</html>
